package top.buluoluo.productservice.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.buluoluo.commoncore.domain.response.Result;
import top.buluoluo.productservice.dto.response.CategoryTreeDTO;
import top.buluoluo.productservice.service.ProductService;

import java.util.List;

@RestController
@RequestMapping("/category")
@Tag(name = "商品分类管理", description = "商品分类管理接口")
public class CategoryController {
    @Autowired
    private ProductService productService;
    @Operation(summary = "获取树形的分类List接口", description = "返回树形的商品分类List")
    @GetMapping("/getAllCategories")
    public  Result<List<CategoryTreeDTO>> getAllCategories() {
        return productService.getAllCategories();
    }
}
